New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add serial::Read/Write implementation #9
Conversation
CC @rust-embedded/embedded-linux |
@posborne You assigned yourself as reviewer a while ago. Have you had a chance to review this PR? |
12: Release new Patch on crates.io with InputPin Support r=therealprof a=Caemor Since #9 still seems to be WIP a small update for crates.io would be nice, so I could move back to the crates.io version of this package. Co-authored-by: Chris <caemor@users.noreply.github.com> Co-authored-by: Chris <github@caemor.de>
Hi hi, sorry this has taken so long, seems like a good addition to me ^_^
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rnestler @ryankurte
My comment here was mostly a drive-by comment to figure out why this is stalled. I'm not very familiar with linux-embedded-hal (or embedded Linux in general), but the various unwrap
s stood out to me (see comments).
Yes, that's what I mean with "this is just a quick PoC" 😉 I wanted some general feedback first before I spend time cleaning it up.
I think I used it on a Raspberry Pi. I can try to come up with example code that uses it. |
50d5b82
to
deccbc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got buried but this seems good to me so approved from my perspective. I would like a review from the HAL team as I'm not quite as up to date on the current discussions around the traits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The serial crate has been split up, we should depend on serial_core instead. You can apply this commit (git apply patch.diff
): https://gist.github.com/dbrgn/3f3509acbb8cc9fdde229138858e5d0d
(Edit: Disregard what I wrote, the patch is wrong because SerialPort
is a trait object. However, we can use serial_unix
instead of serial
, which simplifies a few things. I'll create a new patch soon.)
@rnestler I continued with your branch (after rebasing it against master), see commits here: https://github.com/dbrgn/linux-embedded-hal/commits/implement-serial Feel free to pull them into your branch. The overall implementation seems to work fine, I'm using it successfully here. Regarding the tests, I finished the Would be great if we could get this merged soon after resolving that blocker. |
176fc28
to
77b8d2c
Compare
@dbrgn I integrated your commits and implemented some proper tests using the openpty crate. This lead to me discovering that the errors weren't mapped properly. |
@rnestler what's the status on this? |
96e8151
to
ba9b608
Compare
Ready for review on my side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! thanks for all your effort ^_^
bors r+ |
👎 Rejected by code reviews |
whoops, boop @dbrgn |
d7e4cb7
to
7e5a1bd
Compare
By not using the platform-independent implementation, we can simplify some things.
This allows a user to directly use Serial::open without needing to now about serial_unix::TTYPort.
7e5a1bd
to
b4239f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍 Thanks.
LGTM. bors r+ |
Hmm bors doesn't seem to approve... |
@posborne What is the status on this? |
ahh, iirc bors commands have to be on their own line? bors r+ |
9: Add serial::Read/Write implementation r=ryankurte a=rnestler So this is just a quick PoC to implement #8. @japaric Do you think it would be OK to implement it in that way? If yes I can finish it up. Co-authored-by: Raphael Nestler <raphael.nestler@gmail.com> Co-authored-by: Raphael Nestler <raphael.nestler@sensirion.com> Co-authored-by: Danilo Bargen <mail@dbrgn.ch>
Build succeeded |
Thanks! |
So this is just a quick PoC to implement #8.
@japaric Do you think it would be OK to implement it in that way? If yes I can finish it up.